import { connect } from 'react-redux'
import {completeAllTodos, clearCompleted} from '../actions'
import MainSection from '../components/MainSection'
import { getCompletedTodoCount } from '../selectors'


const mapStateToProps = state => ({
  todosCount: state.todos.length,
  completedCount: getCompletedTodoCount(state)
})




export default connect(
  mapStateToProps,
  {completeAllTodos, clearCompleted}
)(MainSection)

